//
//  GZAEDListCell.swift
//  GZMarathon
//
//  Created by apple on 2021/10/29.
//

import UIKit

class GZAEDListCell: UITableViewCell {

    @IBOutlet weak var coverView: UIView!
    
    @IBOutlet weak var nameLabel: UILabel!
    
    @IBOutlet weak var seriNoLabel: UILabel!
    
    @IBOutlet weak var statusLabel: UILabel!
    
    @IBOutlet weak var statusView: UIView!
    
    var list: GZAEDList?
    
    func setAEDList(_ list: GZAEDList) {
        
        self.list = list
        nameLabel.text = list.aed_name
        seriNoLabel.text = list.aed_serialno

        if list.aed_status == "0"{
            //空闲
            statusView.backgroundColor = .systemGreen
            statusLabel.text = "空闲"
            coverView.backgroundColor = UIColorFromRGB(0xF7F9FF)
        }else{
            //使用中
            statusView.backgroundColor = .systemRed
            statusLabel.text = "使用中"
            coverView.backgroundColor = .white
        }
        
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
